﻿using System;
using System.Collections;
using System.Collections.Generic;
using Glue.Internals;
using Xunit;

namespace GlueTests.TypeExtensionTests
{
    public class When_asking_for_readable_name
    {
        [Fact]
        public void Normal_type_should_look_nice()
        {
            Assert.Equal("ICollection",typeof (ICollection).GetReadableName());
        }

        [Fact]
        public void Primitive_type_should_look_nice()
        {
            Assert.Equal("Double",typeof(double).GetReadableName());
        }

        [Fact]
        public void Nullable_type_should_look_nice()
        {
            Assert.Equal("Int32?",typeof(Int32?).GetReadableName());
        }

        [Fact]
        public void Generic_type_should_look_nice()
        {
            Assert.Equal("KeyValuePair<Int32,String>",typeof(KeyValuePair<Int32,String>).GetReadableName());
        }

        [Fact]
        public void Generic_within_Generic_type_should_look_nice()
        {
            Assert.Equal("IList<KeyValuePair<Int32,String>>", typeof(IList<KeyValuePair<Int32, String>>).GetReadableName());
        }

    }
}
